package com.xingfly.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.xingfly.model.dto.Seat;
import com.xingfly.service.SeatService;
/**
 * 坐位表控制器
 * @author 心之所向-LQ
 * Created by SuperS on 2019/5/22  23:20
 */
@Controller
public class SeatController {
	@Resource
	private SeatService seatService;
	/**
	 * 查询所有坐位状态为0的信息
	 * @return
	 */
	@RequestMapping(value="getAllSeat",produces="text/html;charset=utf-8")
    @ResponseBody
	public String getAllseats() {
		System.out.println("开始进入控制器");
		List<Seat> selByAll = seatService.SelBySeatAll(0);
		Map<String,Object>map=new HashMap<String, Object>();
		map.put("one",selByAll);
		String result = JSONArray.toJSONString(map);
		return result;
	}
}
